package com.security.door.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.security.door.core.base.BaseService;
import com.security.door.dao.mapper.csCardinfoMapper;
import com.security.door.model.domain.csCardinfo;
import com.security.door.model.dto.csCardinfoDto;
import com.security.door.model.vo.csCardinfoVo;
import com.security.door.service.IcsCardinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class csCardinfoServiceImpl extends BaseService<csCardinfo> implements IcsCardinfoService {

    @Autowired
    csCardinfoMapper icsCardinfoMapper;

    public PageInfo<csCardinfoVo> queryListWithPage(csCardinfoDto entity) {
        PageHelper.startPage(entity.getPageIndex(), entity.getPageSize());
        var actionList = icsCardinfoMapper.queryListWithPage(entity);
        return new PageInfo<>(actionList);
    }

    public boolean checkCardNo(csCardinfo entity) {
        return icsCardinfoMapper.checkCardNo(entity) > 0 ? true : false;
    }

    public Integer deleteByIds(String guids) {
        return icsCardinfoMapper.deleteByIds(guids);
    }

    @Override
    public List<csCardinfo> selectNotIssueCars() {
        return icsCardinfoMapper.selectNotIssueCars();
    }
}
